﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace Scala.Logic.Services
{
    public class EventTypeValidation : IValidator<EventType>
    {

        #region IValidator Members

        public bool Validate(EventType instance, out string infoMessage)
        {           
            
            if(instance == null) 
            {
                infoMessage = "Invalid type";
                return false;
            };

            if (String.IsNullOrEmpty(instance.Title))
            {
                infoMessage = "Title is empty";
                return false;
            }

            infoMessage = String.Empty;
            return true;           
        }

        #endregion
    }
}
